home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Secrets 4 / Hacker's Secrets 4.iso / misc / flawsini.txt < prev    next >
Internet Message Format  |  1995-10-13  |  12KB

  1. From owner-best-of-security@suburbia.net  Mon Oct  9 19:32:25 1995
  2. Return-Path: <owner-best-of-security@suburbia.net>
  3. Received: from yarrina.connect.com.au by mail4.netcom.com (8.6.12/Netcom)
  4.     id TAA16986; Mon, 9 Oct 1995 19:32:12 -0700
  5. Received: from suburbia.net (suburbia.apana.org.au [192.188.107.90]) by yarrina.connect.com.au with ESMTP id MAA24837
  6.   (8.6.12/IDA-1.6); Tue, 10 Oct 1995 12:16:38 +1000
  7. Received: (majordom@localhost) by suburbia.net (8.6.12/Proff-950810) id LAA09405 for best-of-security-outgoing; Tue, 10 Oct 1995 11:53:12 +1000
  8. Received: (proff@localhost) by suburbia.net (8.6.12/Proff-950810) id LAA09398 for best-of-security; Tue, 10 Oct 1995 11:52:59 +1000
  9. Received: from relay3.UU.NET (relay3.UU.NET [192.48.96.8]) by suburbia.net (8.6.12/Proff-950810) with ESMTP id JAA07668 for <proff@suburbia.net>; Tue, 10 Oct 1995 09:26:07 +1000
  10. Received: from toad.com by relay3.UU.NET with SMTP 
  11.     id QQzkto29599; Mon, 9 Oct 1995 19:11:32 -0400
  12. Received: by toad.com id AA00554; Mon, 9 Oct 95 14:29:31 PDT
  13. Received: from orodruin.CS.Berkeley.EDU by toad.com id AA00548; Mon, 9 Oct 95 14:29:14 PDT
  14. Received: from espresso.CS.Berkeley.EDU.mammoth (espresso.CS.Berkeley.EDU [128.32.33.40]) by orodruin.CS.Berkeley.EDU (8.7.Gamma.0/8.7.Gamma.0) with SMTP id OAA23443; Mon, 9 Oct 1995 14:29:00 -0700 (PDT)
  15. Received: by espresso.CS.Berkeley.EDU.mammoth (5.x/SMI-SVR4)
  16.     id AA22117; Mon, 9 Oct 1995 14:26:06 -0700
  17. From: gauthier@espresso.CS.Berkeley.EDU (Paul_A Gauthier)
  18. Message-Id: <9510092126.AA22117@espresso.CS.Berkeley.EDU.mammoth>
  19. To: cypherpunks@toad.com, bugtraq@crimelab.com
  20. Cc: gauthier@cs.Berkeley.EDU, brewer@cs.Berkeley.EDU, iang@cs.Berkeley.EDU,
  21.         daw@cs.Berkeley.EDU, fur@netscape.com
  22. Subject: BoS: Basic Flaws in Internet Security and Commerce
  23. Date: Mon, 09 Oct 1995 14:26:06 -0700
  24. Precedence: bulk
  25. Sender: owner-best-of-security@suburbia.net
  26. Errors-to: nobody@connect.com.au
  27. Reply-To: nobody@connect.com.au
  28. Status: RO
  29.  
  30.  
  31. Basic Flaws in Internet Security and Commerce
  32.  
  33. We believe that the current focus on secure session-layer protocols and
  34. sufficient randomness have obscured more fundamental flaws in end-to-end
  35. security. In particular, secure end-to-end transactions require two parts: a
  36. secure protocol to communicate over untrusted channels, and trusted code at
  37. both endpoints. The latter problem has received less attention, but destroys
  38. security regardless of the quality of the protocols or of the random numbers.
  39.  
  40. We have implemented a series of related attacks utilizing IP spoofing:
  41.  
  42.    *  We can spoof NFS to patch binaries on the fly if we are on any subnet
  43.      between the NFS client and NFS server. We used this to turn legitimate
  44.      Netscape browsers into versions that used a fixed key (known only to us),
  45.      thus invisibly eliminating security.
  46.    *  The same trick allows us to defeat Kerberos security by attacking kinit.
  47.    *  We can also spoof NFS file-handle lookups, so that we can replace any
  48.      file (such as .login) with another file that runs with root access
  49.      privileges (even if the requesting user cannot).
  50.  
  51. These work because the trusted path to executables is really not trustworthy in
  52. most environments. Although we use on-the-wire patching to compromise
  53. executables, the client binaries can also be compromised during download, by
  54. on-the-wire patching of FTP or HTTP transfers. Trojan horses and viruses could
  55. also patch the client software after it's on the local disk, especially on
  56. systems like Windows 95 that do not provide access control for files.
  57.  
  58. Given that these are realistic threats, we believe that these issues must be
  59. resolved before internet security and commerce are realistic.
  60.  
  61. -------------------------------------------------------------------------------
  62.  
  63. We began to consider in more detail some fundamental weaknesses of common
  64. network security practices that would lead to trivial further attacks on
  65. Netscape as well as many other security tools like Kerberos. It was our goal to
  66. demonstrate that it is trivially possible to patch executables on-the-wire to
  67. completely compromise their security.
  68.  
  69. In doing so, we hope to reinforce the point that security is an end-to-end
  70. problem that is far harder than getting the protocols correct. Strong, correct
  71. protocols only make more subtle endpoint attacks more likely, especially in
  72. light of the potential for financial gain as the amount of commerce on the
  73. Internet increases. Most of the attacks we discuss are suitable for the
  74. systematic exploitation of large groups of users: an entire organization, or
  75. even a large fraction of the user base of a particular piece of software.
  76.  
  77. In many computing environments a pool of common executables, like the Netscape
  78. binary, are provided to clients by a fileserver. In such systems, including
  79. NFS, AFS and Windows NT, there is no authentication of the file contents sent
  80. between clients and servers.
  81.  
  82. In these systems there are provisions for sophisticated access checks to
  83. determine file permissions, at open or handle lookup time. But the file
  84. contents that are read from the server are not authenticated in any secure way.
  85. The client has no way to determine if the bytes are indeed being sent by the
  86. server.
  87.  
  88. Our first attack model is one in which the attacker has (promiscuous) network
  89. access to any machine on any ethernet subnet between the fileserver and the
  90. clients under attack. In under a day we produced software that can exploit the
  91. lack of authentication in NFS to patch the object code of any executable
  92. on-the-wire as it travels between the NFS server and the client machine.
  93.  
  94. The technical details of the attack are rather simple. To retrieve data from
  95. the NFS server a client sends a short request message detailing which block
  96. from the file it is interested in (where a block is a range of bytes). The
  97. attack software is located on an ethernet segment between the client and the
  98. NFS server, so is able to snoop this traffic.
  99.  
  100. The attack software snoops, waiting for any request for a particular block of a
  101. particular executable; for example, the block containing the session-key
  102. generation code in the Netscape executable. It is then able to forge a reply
  103. from the NFS server and transmit it to the client. If the forged packet reaches
  104. the client before the legitimate reply, it is accepted and the legitimate reply
  105. is discarded as a duplicate.
  106.  
  107. There is obviously a race condition between the injection of the forged
  108. response and the true response. Since the attacking software is focused solely
  109. on this task, while the fileserver is certainly servicing requests from many
  110. clients, it stands a very good chance of winning the race. We have observed
  111. that the attacking software wins the race a large fraction of the time.
  112.  
  113. Given this ability it becomes possible to compromise the security features of
  114. any executable loaded from the network. We have examined the Netscape v1.1N
  115. executable and located the code that selects the session key. By patching only
  116. 4 bytes we were able to cause the selection of a predictable session key every
  117. time the browser engages in the SSL protocol. It is then trivial to snoop and
  118. decrypt all traffic from the browser to secure servers, obtaining credit card
  119. numbers or other private information.
  120.  
  121. Since this is really an attack on the client, it is not limited to the Netscape
  122. browser. On the contrary, it is extremely widely applicable. An appropriate
  123. patch to the Kerberos kinit executable makes possible the compromise of any
  124. passwords entered by users, and therefore all of the authentication facilities
  125. provided by Kerberos.
  126.  
  127. In many environments, including our own here at UC Berkeley, all the Kerberos
  128. application binaries are served from an NFS server. This represents a major
  129. flaw in security as our attack demonstrates. Having authenticated file services
  130. (kerberized NFS or AFS) is useless if the integrity of the kinit executable
  131. cannot be ensured (most easily by obtaining it from local disk).
  132.  
  133. However, making local copies of crucial binaries is not sufficient in the face
  134. of a more serious set of variants on the NFS spoofing attack. The spoofing
  135. software can be placed as before, in a position to snoop requests to the NFS
  136. server. As clients issue a lookup filehandle request the spoofing software can
  137. return the handle to a different executable and also forge its attributes. By
  138. tricking users into executing code that is setuid root, unlimited access to the
  139. client's workstation can be obtained easily.
  140.  
  141. It is possible to mount NFS partitions so that setuid root executables will not
  142. be honored by the client. Still, the spoofing software can make arbitrary NFS
  143. filehandle lookup requests succeed, and substitute a trojan of some sort. The
  144. attacker could cause misspellings of commonly executed commands to appear to
  145. succeed, or could spoof other files that are trusted by the operating system.
  146. For example, the user's .login file is a natural and easy target from which to
  147. leverage further damage.
  148.  
  149. This implies that it is unsafe to execute any program obtained via an insecure
  150. channel to an NFS server, no matter what the privilege level of the client
  151. user.
  152.  
  153. Neither is it limited to NFS or file-serving protocols in particular. Protocols
  154. based on TCP, rather than UDP, are just as vulnerable. It is possible to hijack
  155. non-authenticated TCP connections, although it is somewhat more complicated.
  156.  
  157. Attacks based on spoofing traffic coming from the distribution site of popular
  158. software packages is also possible. Berkeley, for example, is a mirror site for
  159. the Netscape browser. Any student with promiscuous network access on a machine
  160. between the ftp server and the main link to the larger Internet could have
  161. installed similar patching software to patch the huge number of copies of the
  162. binary that were retrieved from server.berkeley.edu.
  163.  
  164. More mundane attacks based on trojan horses or viruses remain viable today.
  165. These attacks must exploit some other weakness in a system's security to
  166. infiltrate, but once in place they can perform patches to local binaries to
  167. fully compromise a system. Previously such attacks were mostly motived only by
  168. ego or malice; it is now more valuable to compromise a client invisibly, so
  169. that the user believes the system is secure. Thus, unlike traditional viruses,
  170. the new strains will aim to have no visible effect on the system, thus making
  171. them difficult to detect and easy to spread unintentionally. Our patch of
  172. Netscape has this flavor.
  173.  
  174. We realize that it is impossible to eliminate all security holes; one can
  175. always question whether it is safe to trust the hardware, or whether outside
  176. channels used for communication of public keys or checksums are truly secure,
  177. etc. Fortunately, in practice it should suffice to handle far less than all of
  178. these risks. We hope to have demonstrated one gaping hole in practical security
  179. today, and to have highlighted the problem of the trusted endpoint.
  180.  
  181. There is one simple step that we can suggest that would go a long way towards
  182. improving the security of endpoints. Increasing the practice of software
  183. providers widely publishing cryptographically secure checksums of their
  184. executables would be extremely helpful. A small amount of paranoia and care
  185. must be applied to securing the executables used in the verification process. A
  186. read-only floppy disk would be appropriate to hold the verification software,
  187. for example.
  188.  
  189. We are concerned that security on users' workstations and PCs is currently
  190. insufficient. When real money is at stake, endpoint security must withstand
  191. greater scrutiny. In summary, protecting the communications channel doesn't
  192. help if the endpoints can be subverted. We implemented and discussed several
  193. related attacks that replace legitimate programs by compromised versions. Until
  194. we can trust every program that executes between the time we boot and the time
  195. we finish the secure protocol, we cannot reliably authenticate anything. Today
  196. there is no basis for this trust.
  197.  
  198. Eric Brewer, brewer@cs.berkeley.edu
  199. Paul Gauthier, gauthier@cs.berkeley.edu
  200. Ian Goldberg, iang@cs.berkeley.edu
  201. David Wagner, daw@cs.berkeley.edu
  202.  
  203. A copy of this post is available as
  204. http://http.cs.berkeley.edu/~gauthier/endpoint-security.html
  205.  
  206.